package com.ymatou.iapi.login.testcase;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.login.parameter.FlashQueryMobileBean;
import com.ymatou.iapi.login.service.FlashQueryMobileCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
import com.ymttest.utils.TestDataManager;
/**
*闪验获取手机号
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_FlashQueryMobile{
	private static FlashQueryMobileBean flashquerymobileBean;
	private static FlashQueryMobileCall flashquerymobileCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("闪验获取手机号");
	}

	@Before
	public void caseUp() {
		flashquerymobileBean=new FlashQueryMobileBean();
		flashquerymobileCall=new FlashQueryMobileCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(flashquerymobileCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_FlashQueryMobile_001() {
		Logger.start(true,"闪验获取手机号");
		try {
			flashquerymobileBean.setClientIp(TestDataManager.getRandomIp());
			flashquerymobileBean.setTerminalSource(2);
			flashquerymobileBean.setToken(TestDataManager.getRandomUUID().toString());
			flashquerymobileCall.setData(flashquerymobileBean);
			flashquerymobileCall.callService();			
			Logger.verifyEquals("5000", flashquerymobileCall.getString("code"), "验证code");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}